#ifndef _MIXP_PROCESS_MASTER_H
#define _MIXP_PROCESS_MASTER_H

#include "mixedprocess.h"
#include "server/mixp_skt_server.h"
#include "module/mixp_module_manager.h"

typedef struct mixp_master
{
    mixp_config_t *conf;
    int running;
    int ready;

    mixp_skt_server_t *server;
    mixp_module_manager_t *module_manager;

    struct hash *dict_workers; //key根据flow name区分，一个flow new一个mixp_worker_t
} mixp_master_t;

#ifdef __cplusplus
extern "C"
{
#endif

    mixp_int_t mixp_master_init(mixp_config_t *);
    mixp_master_t const *mixp_master_instance();
    void mixp_master_free();
    void mixp_master_run();
    void mixp_master_stop();

    mixp_worker_info_t *mixp_master_pick_worker(pid_t);

#ifdef __cplusplus
};
#endif
#endif